import Page from "@/views/Page.vue";
import Home from "@/views/Home.vue";
import Boss from "@/views/Boss.vue";
import Business from "@/views/Business.vue";
import UserCenter from "@/views/UserCenter.vue";

export default [
  {
    path: "/",
    alias: "/home_page",
    component: Page,
    children: [
      {
        path: "",
        component: Home,
        meta: {
          title: "首页"
        }
      }
    ]
  },
  {
    path: "/boss",
    component: Page,

    children: [
      {
        path: "",
        meta: {
          title: "董事中心",
          requireAuth: true
        },
        component: Boss
      }
    ]
  },
  {
    path: "/business",
    component: Page,

    children: [
      {
        path: "",
        meta: {
          title: "联创中心",
          requireAuth: true
        },
        component: Business
      }
    ]
  },
  {
    path: "/user_center",
    component: Page,

    children: [
      {
        path: "",
        meta: {
          title: "会员中心",
          requireAuth: true
        },
        component: UserCenter
      }
    ]
  },
  {
    path: "/about",
    name: "about",
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ "@/views/About.vue")
  },
  {
    path: "/become_boss",
    name: "become_boss",
    meta: {
      title: "成为董事",
      requireAuth: true
    },
    component: () => import("@/views/Home/BecomeBoss.vue")
  },
  {
    path: "/boss_stock",
    name: "boss_stock",
    meta: {
      title: "董事补货",
      requireAuth: true
    },
    component: () => import("@/views/Home/BossStock.vue")
  },
  {
    path: "/withdrawal",
    name: "withdrawal",
    meta: {
      title: "余额提现",
      requireAuth: true
    },
    component: () => import("@/views/Withdrawal.vue")
  },
  {
    path: "/bonus",
    name: "bonus",
    meta: {
      title: "区域分红",
      requireAuth: true
    },
    component: () => import("@/views/Home/Bonus.vue")
  },
  {
    path: "/bonus_boss",
    name: "bonus_boss",
    meta: {
      title: "董事分红",
      requireAuth: true
    },
    component: () => import("@/views/Home/BonusBoss.vue")
  },
  {
    path: "/service_center",
    name: "service_center",
    meta: {
      title: "客服中心",
      requireAuth: true
    },
    component: () => import("@/views/Home/CustomerServiceCenter.vue")
  },
  {
    path: "/goods_center",
    name: "goods_center",
    meta: {
      title: "产品中心",
      requireAuth: true
    },
    component: () => import("@/views/Home/GoodsCenter.vue")
  },
  {
    path: "/my_team/:active",
    name: "my_team",
    meta: {
      title: "我的团队",
      requireAuth: true
    },
    component: () => import("@/views/Home/MyTeam.vue")
  },
  {
    path: "/user_center/my_orders/:type",
    name: "my_orders",
    meta: {
      title: "我的订单",
      requireAuth: true
    },
    component: () => import("@/views/UserCenter/MyOrders.vue")
  },
  {
    path: "/user_center/user_info",
    name: "user_info",
    meta: {
      title: "会员资料",
      requireAuth: true
    },
    component: () => import("@/views/UserCenter/UserInfo.vue")
  },
  {
    path: "/user_center/update_mobile",
    name: "update_mobile",
    meta: {
      title: "绑定手机",
      requireAuth: true
    },
    component: () => import("@/views/UserCenter/UpdateMoblie.vue")
  },
  {
    path: "/user_center/balance_details",
    name: "balance_details",
    meta: {
      title: "余额明细",
      requireAuth: true
    },
    component: () => import("@/views/UserCenter/BalanceDetails.vue")
  },
  {
    path: "/purchase_record/:active/:group_member_id/:name/:type",
    name: "purchase_record",
    meta: {
      title: "购买记录",
      requireAuth: true
    },
    component: () => import("@/views/Home/PurchaseRecord.vue")
  },
  {
    path: "/login",
    name: "login",
    meta: {
      title: "登录"
    },
    component: () => import("@/views/UserCenter/Login.vue")
  },
  {
    path: "/register",
    name: "register",
    meta: {
      title: "注册"
    },
    component: () => import("@/views/UserCenter/Register.vue")
  },
  {
    path: "/forget_password",
    name: "forget_password",
    meta: {
      title: "忘记密码"
    },
    component: () => import("@/views/UserCenter/ForgetPassword.vue")
  },
  {
    path: "*",
    component: () => import("@/views/Home.vue")
    // component: () => import("@/views/error_404.vue")
  }
];
